import pygame
pygame.init()

class DisplayObj:

    UP = 0
    DOWN = 1
    LEFT = 2
    RIGHT = 3

    Speed = [0,0]
    
    Image = None
    Screen = None
    ObjRect = None
    Drection = 0
    
    def __init__ (self,Image,Screen):
        self.Image = Image
        self.Screen = Screen
        self.ObjRect = self.Image.get_rect()
        self.Drection = self.RIGHT
        self.Size = Screen.get_size()

    def Up(self):
        self.Drection = self.UP

    def Down(self):
        self.Drection = self.DOWN

    def Left(self):
        self.Drection = self.LEFT

    def Right(self):
        self.Drection = self.RIGHT

    
    def Display(self):
        if (self.Drection == self.UP):
            self.Speed = [0,-50]            
        elif (self.Drection == self.DOWN):
            self.Speed = [0,50]            
        elif (self.Drection == self.LEFT):
            self.Speed = [-50,0]            
        else:
            self.Speed = [50,0]

        print self.Size

        if (self.ObjRect.left < 0):
            self.ObjRect.left = 0
            self.Speed = [0,0]
        if (self.ObjRect.right >= self.Size[0]):
            self.ObjRect.right = self.Size[0]
            self.Speed = [0,0]
        if (self.ObjRect.top < 0):
            self.ObjRect.top = 0
            self.Speed = [0,0]
        if (self.ObjRect.bottom >= self.Size[1]):
            self.ObjRect.bottom = self.Size[1]
            self.Speed = [0,0]

        if (self.ObjRect.
        self.ObjRect = self.ObjRect.move(self.Speed)
        
        self.Screen.blit(self.Image,self.ObjRect)
      
